#pragma once
namespace yjt
{
	template<class Iterator,class Ref,class Ptr>
	struct ReverseIterator
	{
		typedef ReverseIterator<Iterator, Ref, Ptr>self;
		Iterator cur;

		ReverseIterator(Iterator it)
			:cur(it)
		{}
		   
		self& operator++()
		{
			cur--;
			return *this;
		}
		self& operator--()
		{
			cur++;
			return *this;
		}
		Ref operator*()
		{
			self tmp = cur;
			++tmp;
			return *tmp;
		}
		bool operator!=(const self& s)
		{
			return cur != s.cur;
		}
	};
}
